/***************************************************************************
 *   Copyright (C) 2007 by netwan   *
 *   root@double_link   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef main_callback_H
#define main_callback_H
#include "ui_mainform.h"
#include <QMainWindow>
#include <list>
#include <map>
#include <pcap.h>
#include "PubDefine.h"
#include <QMutex>
#include <QStandardItem>
#include "widgets/qhexview/QHexView.h"
class Tfrmmain : public QMainWindow
{
Q_OBJECT
public:
Tfrmmain();
private slots:
    void fileExit();
    void fileOpen();
    void fileSave();
    void fileStart();
    void fileStop();
    void snifferSelectNid();
    void about();
public slots:
	void showThreadInfo(const QString&);
    void OnstartCat();
    void OnendCat();
    void OnOpenDevice();
    void OnCatchPACKET(nodedata* node);
    void lvw_root_itemclicked(const QModelIndex &);
    void lvw_sub_itemclicked(const QModelIndex &);
private:
	QMutex mutex;
	QVector<uint8_t> stream;
    Ui::TMainForm ui;
    QHexView* memHex;
    virtual void closeEvent(QCloseEvent * event);
    void ClearCapData();
    void AddSubNodes(nodedata* ,bool );
    void SetNodeTagData(QStandardItem* ,int ,int ,int ,int );
    QStandardItem * addTreeViewItem(QStandardItemModel *model,QStandardItem* parent,char *fmt, ...);
    bool dataSaved;
};

#endif
